package com.ruoyi.business.controller;

import com.ruoyi.business.domain.AlarmInfo;
import com.ruoyi.business.service.IAlarmInfoService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统警报信息Controller
 *
 * @author qiancheng
 * @date 2025-09-02
 */
@RestController
@RequestMapping("/business/alarm") // 接口路径：业务模块/警报管理
public class AlarmInfoController extends BaseController {
    @Autowired
    private IAlarmInfoService alarmService;

    /**
     * 按条件查询警报列表，支持时间范围和等级筛选
     * @return 符合条件的警报列表
     */
    @Anonymous
    @GetMapping("/list")
    public TableDataInfo getAlarmList(AlarmInfo alarmInfo) {
      return getDataTable(alarmService.selectAlarmListByTimeRange(alarmInfo));
    }
}